#pragma once

#include "connection.h"
#include "schema.h"
#include "DMLGroup.h"

using namespace Teradata::Client::Provider;

namespace TdParallelTransportApi {

public ref class TdColumn
{
public:
	TdColumn(System::String^ definition);

	TdColumn(System::String^ columnName, TdType dataType);

	TdColumn(System::String^ columnName, TdType dataType, int length);

	TdColumn(System::String^ columnName, TdType dataType, int precision, int scale);

	property System::String^ ColumnName
	{
		System::String^ get();
	}

	property TdType DataType
	{
		TdType get();
	}

	property int Length
	{
		int get();
	}

	property int Precision
	{
		int get();
	}

	property int Scale
	{
		int get();
	}

	property int Size
	{
		int get();
	}

	static TD_DataType GetTdDataType(TdType type);
private:
	System::String^ m_ColumnName;
	TdType m_DataType;
	int m_Length;
	int m_Precision;
	int m_Scale;
	int m_Size;

	void InitializeType(TdType dataType);
	void InitializeType(TdType dataType, int length);
	void InitializeType(TdType dataType, int precision, int scale);
};

}
